package com.bionic.CES.beans;

import java.io.Serializable;
import java.sql.Date;

public class Officialbankrate implements Serializable {

    protected Integer officialbankrateId;
    protected String currencyFrom;
    protected String currencyTo;
    protected Double rate;
    protected Date date;

    public Officialbankrate() {
    }

    public Officialbankrate(int officialbankrateId, String currencyFrom, String currencyTo,
            Double rate, Date date) {
        super();
        this.officialbankrateId = officialbankrateId;
        this.currencyFrom = currencyFrom;
        this.currencyTo = currencyTo;
        this.rate = rate;
        this.date = date;
    }

    public Integer getOfficialbankrateId() {
        return officialbankrateId;
    }

    public void setOfficialbankrateId(Integer officialbankrateId) {
        this.officialbankrateId = officialbankrateId;
    }

    public String getCurrencyFrom() {
        return currencyFrom;
    }

    public void setCurrencyFrom(String currencyFrom) {
        this.currencyFrom = currencyFrom;
    }

    public String getCurrencyTo() {
        return currencyTo;
    }

    public void setCurrencyTo(String currencyTo) {
        this.currencyTo = currencyTo;
    }

    public Double getRate() {
        return rate;
    }

    public void setRate(Double rate) {
        this.rate = rate;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @Override
    public String toString() {
        return "Officialbankrate [officialbankrateId=" + officialbankrateId
                + ", currencyFrom=" + currencyFrom + ", currencyTo=" + currencyTo + 
                ", rate=" + rate + ", date=" + date + "]";
    }

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((currencyFrom == null) ? 0 : currencyFrom.hashCode());
		result = prime * result
				+ ((currencyTo == null) ? 0 : currencyTo.hashCode());
		result = prime * result + ((date == null) ? 0 : date.hashCode());
		result = prime * result + officialbankrateId;
		long temp;
		temp = Double.doubleToLongBits(rate);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof Officialbankrate))
			return false;
		Officialbankrate other = (Officialbankrate) obj;
		if (currencyFrom == null) {
			if (other.currencyFrom != null)
				return false;
		} else if (!currencyFrom.equals(other.currencyFrom))
			return false;
		if (currencyTo == null) {
			if (other.currencyTo != null)
				return false;
		} else if (!currencyTo.equals(other.currencyTo))
			return false;
		if (date == null) {
			if (other.date != null)
				return false;
		} else if (!date.equals(other.date))
			return false;
		if (officialbankrateId != other.officialbankrateId)
			return false;
		if (Double.doubleToLongBits(rate) != Double
				.doubleToLongBits(other.rate))
			return false;
		return true;
	}
}
